package cn.itcast.service.impl;

import cn.itcast.dao.AccountDao;
import cn.itcast.domain.Account;
import cn.itcast.service.AccountService;

import java.util.List;

public class AccountServiceImpl implements AccountService {
    private AccountDao accountDao;

    public void setAccountDao(AccountDao accountDao) {
        this.accountDao = accountDao;
    }

    public List<Account> findAll() {
        return accountDao.findAll();
    }

    public Account save(Account account) {
        accountDao.save(account);
        return account;
    }

    public Account update(Account account){
        accountDao.update(account);
        return account;
    }

    public Account delete(Integer id) {
        accountDao.delete(id);
        return null;
    }

    public Account findById(Integer id) {
        return accountDao.findById(id);
    }
}
